package et.item.drill;

import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;

/**
 * Created by winston_wang on 2017/6/29.
 */
public class ETItemWindDrill extends ETItemDrill {
    public ETItemWindDrill(){
        super(8.0f, 80.0f, 57000, 100, 1, 10,90.0f);
        setTextureName("et:itemVoidWindDrill");
        setUnlocalizedName("windVoidDrill");
    }

    @Override
    public boolean hitEntity(ItemStack par1ItemStack,
                             EntityLivingBase par2EntityLivingBase,
                             EntityLivingBase par3EntityLivingBase) {
        par1ItemStack.damageItem(1, par3EntityLivingBase);
        if (par3EntityLivingBase.worldObj.isRemote) {
            return true;
        }
        float Angle = (par3EntityLivingBase.rotationYaw/ 180F) * 3.141593F;
        float x = 5f * -MathHelper.sin(Angle);
        float y = 1f;
        float z = 5f * MathHelper.cos(Angle);
        par2EntityLivingBase.setVelocity(x, y, z);
        return true;
    }
}
